package doyouknow.group.CnAndZhb.controller;

import doyouknow.group.CnAndZhb.service.GetDeviceService;
import doyouknow.group.CnAndZhb.entity.DeviceBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by star on 2020/10/29.
 */
@Controller
@CrossOrigin
public class BianMa {

    @Autowired
    private GetDeviceService getDeviceService;

    @RequestMapping("/cecece")
    @ResponseBody
    public String cecece() {
        List<DeviceBean> aa=getDeviceService.get_test("cn");
        System.out.println(aa.get(0));
        if(aa.size()>0){
            return aa.get(0).getUser_acct();
        }else{
            return "米有找到";
        }

    }

}
